package com.whut.controller;

import com.whut.model.Orderinfo;
import com.whut.service.OrderService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/order")
public class OrderController {
    @Resource
    private OrderService orderService;
/***
 * @auther lyl
 * //TODO
 * @date 20:42 2019/11/6
 * @param
 * @return java.lang.Object
*/
    @ResponseBody
    @PostMapping("/addOrderInfo")
    public Object addOrderInfo(Orderinfo orderInfo) {
        System.out.println(orderInfo);
        return orderService.addOrderInfo(orderInfo);
    }

    @ResponseBody
    @PostMapping("/getOrderInfo")
    public Object getOrderInfo(int id){
        return orderService.getOrderInfo(id);
    }

    @ResponseBody
    @PostMapping("/deleteCurRow")
    public Object deleteCurRow(int mkey){
        System.out.println(mkey);
        return orderService.deleteCurRow(mkey);
    }
}
